package zlatan_demo13_match

object ClassDemo06 {
  //需求：筛选出年龄大于23的学生信息
  def main(args: Array[String]): Unit = {
    val map1 = Map("张三" -> 23, "李四" -> 24, "王五" -> 23, "赵六" -> 26)
    //法一：通过if语句实现
    for ((k, v) <- map1 if v == 23) println(k, v)
    println("*"* 20)
    //法二:通过固定值实现
    for ((k,23)<-map1)println(k,23)

  }

}
